﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MarsWorkUtility
{
    public partial class Main_Form : Form
    {
        public Main_Form()
        {
            InitializeComponent();
        }
        public void Main_Form_Load(object sender, EventArgs e)
        {
            try
            {
                string HostPath = @"./test.txt";
                string HostName;
                string HostAddress;
                string HostPosition;
                string str_Host = "";
                TreeNode LeafNode;
                //Host_TreeView.Left = 0;
                //Host_TreeView.Top = 0;
                //Host_TreeView.Height = Main_Form.ActiveForm.Height;
                //Host_TreeView.Width = Main_Form.ActiveForm.Width;

                //Telnet My_telnet = new Telnet("bbs.sjtu.edu.cn", 23, 15);
                //if (My_telnet.Connect() == false)
                //{
                //    textBox1.Text = "Oooops!";
                //}
                //if (My_telnet.Connect() == true)
                //{
                //    textBox1.Text = "OK";
                //}

                HostName = "L5S-2960-1";
                HostAddress = "172.18.1.132";
                HostPosition = "L5S";
                File_OP test = new File_OP();
                test.Write(HostPath, HostPosition,HostName, HostAddress);
                str_Host = test.Read(HostPath);

                TreeView_OP Tree = new TreeView_OP();
                LeafNode = Tree.FillRootNode(Host_TreeView, HostPosition);
                Tree.FillLeafNode(HostPath,LeafNode);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
    
        }
    }
}
